#ifndef PICEDITOR_H
#define PICEDITOR_H

#include <QThread>
#include <qpixmap.h>
#include <qmutex.h>
class PicEditor : public QThread
{
    Q_OBJECT
public:

	explicit PicEditor(QObject *parent = 0);
	~PicEditor();
	const QPixmap *pixmap();
	QMutex mutex;
	void openPic(const QString &fileName,double scaleFactor=1);
	void scalePic(const double &scaleFactor,const QPixmap *p);
	void rotatePic(int rr);
signals:
	void changed(QPixmap p);
public slots:
private:
	enum Com {open,scale,rotate} com;
	void run();
	void openPic();
	void scalePic();
	void rotatePic();
	QPixmap *pix;
	QSize pixsize;
	QString fn;
	double sf;
	int r;
	bool end;
};

#endif // PICEDITOR_H
